package com.xmtlxx.common.enums;

/**
 * 财物日志节点
 *
 * @author xmtlxx
 */
public enum PropertyLogNode {
    NODE_1("1", "所队接收"),
    NODE_2("2", "所队出库/移送"),
    NODE_3("3", "区县接收"),
    NODE_4("4", "区县出库/移送"),
    NODE_5("5", "市中心接收"),
    NODE_6("6", "市中心出库/移送");

    private final String code;
    private final String info;

    PropertyLogNode(String code, String info) {
        this.code = code;
        this.info = info;
    }

    public String getCode() {
        return code;
    }

    public String getInfo() {
        return info;
    }

    /**
     * @param type 3、市级 2、区级 1、 所级
     * @param buss 0-移交登记 1-入库 2-出库 3-调用 4-处置 5-交接 6-上架
     *            7-挑拣 8-取件 9-派车 10-运输 11-暂存
     * @return
     */
    //                0-移交登记 1-入库 2-出库 3-调用 4-处置 5-取件交接 6-上架 7-挑拣
//                8-取件 9-派车 10-运输 11-暂存交接 12-签收 13-到货交接 14-出库交接
    public static String getNodeCodeByBuss(Long type,String buss){
        type = type == null ? 1l : type;
        //所队
        if(type == 1){
            if(buss == "0" || buss == "5" ){
                return NODE_1.getCode();
            }else{
                return NODE_2.getCode();
            }
        }else if(type == 2){//区级
            if(buss == "0" || buss == "5"  || buss == "13"){
                return NODE_3.getCode();
            }else{
                return NODE_4.getCode();
            }
        }else if(type == 3){//市级
            if(buss == "0" || buss == "5" || buss == "6"|| buss == "7" || buss == "8"|| buss == "9"|| buss == "10"|| buss == "11"|| buss == "12"|| buss == "13"|| buss == "14"){
                return NODE_5.getCode();
            }else{
                return NODE_6.getCode();
            }
        }
        return null;
    }
}
